package hn.cch.dao.impl;

import hn.cch.dao.TermDao;
import hn.cch.jdbc.JdbcDao;
import hn.cch.model.Term;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Created by chench on 2020-5-21.
 */

@Component(value = "termDao")
public class TermDaoImpl extends JdbcDao implements TermDao {
    @Override
    public List<Term> getAll() {
        StringBuffer sql = new StringBuffer();
        sql.append("select play_id,play_ename,term_code from hot_term");
        List<Term> list = getSecretJdbcTemplate().query(sql.toString(), new BeanPropertyRowMapper(Term.class));
        return list;
    }
}
